package com.atzzy.ysmall.ysmall_api.SearchController;

import com.alibaba.dubbo.config.annotation.Reference;
import com.atzzy.ysmall.ysmall_allService.ProductService.ProService;
import com.atzzy.ysmall.ysmall_common.vo.R;
import org.springframework.web.bind.annotation.*;

/**
 * @Author JAVAZeng
 * @Date 2022/4/9 23:58
 * @Version 1.0
 */
@RestController
@RequestMapping("searchService")
@CrossOrigin
public class SearchController {

    @Reference
    private ProService proService;

    @GetMapping("listbrands")
    public R getBrandsByCategoryId(@RequestParam("category") int category){
        return proService.listBrands(category);
    }
    @GetMapping("listbrandsByKeyword")
    public R getBrandsByKeyword(@RequestParam("keyword") String keyword){
        return proService.listBrands(keyword);
    }
}
